package hmy.com.controller;

import hmy.com.integration.MessageSendMQ;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class MessageController {

    @Resource
    private MessageSendMQ messageMQ;

    @GetMapping(path = "/send/{msg}")
    public void sendMsgToMq(@PathVariable(name = "msg") String Msg){
        messageMQ.msg().send(MessageBuilder.withPayload(Msg).build());
    }

}
